package com.freesky.web.portal.reomte;

import com.freesky.common.dao.entity.Order;
import com.freesky.common.utils.reponse.JSONResponse;
import com.freesky.common.vo.VOOrder;
import com.freesky.common.vo.VOOrderInfo;
import com.freesky.common.vo.VOThanks;
import com.freesky.web.portal.reomte.fallback.OrderRemoteFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@FeignClient(name = "emall-provider-zuul", fallback = OrderRemoteFallback.class)
public interface OrderRemote {
    String ZUUL_URL_PREFIX ="/mysevice/order";
    @GetMapping(value = ZUUL_URL_PREFIX + "/order/member/list")
    JSONResponse getMemberOrderList(
            @RequestParam(value = "userId") String userId,
            @RequestParam(value = "page", defaultValue = "1") int page,
            @RequestParam(value = "size", defaultValue = "5") int size);

    @GetMapping(value = ZUUL_URL_PREFIX+"/order/detail")
    JSONResponse getOrderById(@RequestParam(value = "orderId")String orderId);

    @GetMapping(value = ZUUL_URL_PREFIX+"/order/member/detail")
    JSONResponse getOrder(String orderId);

    @PostMapping(value =ZUUL_URL_PREFIX+ "/order/member/add")
    JSONResponse addOrder(@RequestBody VOOrderInfo orderInfo);

    @PostMapping(value = ZUUL_URL_PREFIX+"/order/member/cancel")
    JSONResponse cancelOrder(@RequestBody VOOrder order);

    @GetMapping(value =ZUUL_URL_PREFIX+ "/order/member/del")
    JSONResponse delOrder(String orderId);

    @PostMapping(value = ZUUL_URL_PREFIX+"/order/member/pay")
    JSONResponse payOrder(@RequestBody Order order);
}
